package com.hnust.dao;

import com.hnust.domain.GradRequirements;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface GradRequirementsDao {

	@Select("select * from grad_requirements where grad_id=#{id}")
	@ResultType(GradRequirements.class)
	GradRequirements getGradReqById(String id);

	//通过专业id获取毕业要求id和内容
	@Select("select grad_id,content from grad_requirements where maj_id=#{majorId}")
	@ResultType(GradRequirements.class)
	List<GradRequirements> getGradReqByMajorId(String majorId);

	//更新毕业指标点   焦
	@Update("update grad_requirements set content =#{content} where grad_id=#{gradId}")
	Integer updateContent(String content,String gradId);
}
